<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">代理反馈列表</div>
                </div>
                <div class="widget-body am-fr">
                    <!-- 工具栏 -->
<!--                    <div class="page_toolbar am-margin-bottom-xs am-cf">-->
<!--                        <form class="toolbar-form" action="">-->
<!--                            <input type="hidden" name="s" value="">-->
<!--                            <div class="am-u-sm-12 am-u-md-9 am-u-sm-push-3">-->
<!--                                <div class="am fr">-->
<!---->
<!--                                    <div class="am-form-group am-fl">-->
<!---->
<!--                                        <select name="gender" data-am-selected="{btnSize: 'sm', placeholder: '请选择'}">-->
<!--                                            <option value="1">已处理</option>-->
<!--                                            <option value="0">未处理</option>-->
<!--                                        </select>-->
<!--                                    </div>-->
<!--                                    <div class="am-form-group am-fl">-->
<!--                                        <div class="am-input-group am-input-group-sm tpl-form-border-form">-->
<!---->
<!--                                            <div class="am-input-group-btn">-->
<!--                                                <button class="am-btn am-btn-default am-icon-search"-->
<!--                                                        type="submit"></button>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                        </form>-->
<!--                    </div>-->
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>代理商</th>
                                <th>反馈内容</th>
                                <th>截图</th>
                                <th>反馈时间</th>
                                <th>状态</th>
                                <th>操作</th>

                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['agent_id'] ?></td>
                                    <td class="am-text-middle"><?= $item['title'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= $item['image'] ?>" title="点击查看大图" target="_blank">
                                            <img src="<?= $item['image'] ?>" width="72" height="72" alt="">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['createtime'] ?></td>
                                    <td class="am-text-middle">
                                        <?php if ($item['status']==1){
                                             echo '已处理';
                                        }else{
                                            echo  '未处理';
                                        }
                                        ?>
                                    </td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <?php if ($item['status']==0):?>
                                                <?php if (checkPrivilege('feedback.store/grade')): ?>
                                                <a class="j-grade tpl-table-black-operation-default"
                                                   href="javascript:void(0);"
                                                   data-id="<?= $item['id'] ?>"
                                                   title="处理备注">
                                                    <i class="iconfont icon-grade-o"></i>
                                                    备注
                                                </a>
                                            <?php endif; ?>
                                            <?php endif; ?>

                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="12" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 模板：修改会员等级 -->
<script id="tpl-grade" type="text/template">
    <div class="am-padding-xs am-padding-top">
        <form class="am-form tpl-form-line-form" method="post" action="">
            <div class="am-tab-panel am-padding-0 am-active">

                <div class="am-form-group">
                    <label class="am-u-sm-3 am-form-label">备注 </label>
                    <div class="am-u-sm-8 am-u-end">
                                <textarea rows="2" name="grade[remark]"
                                          class="am-field-valid"></textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
</script>


<script>
    $(function () {
        /**
         * 修改会员等级
         */
        $('.j-grade').on('click', function () {
            var data = $(this).data();
            $.showModal({
                title: '备注'
                , area: '460px'
                , content: template('tpl-grade', data)
                , uCheck: true
                , success: function ($content) {
                }
                , yes: function ($content) {
                    $content.find('form').myAjaxSubmit({

                        url: '<?= url('feedback.store/grade') ?>',
                        data: {id: data.id}
                    });
                    return true;
                }
            });
        });


    });
</script>

